﻿
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityWebSocket;
using DG.Tweening;
//SingletonManager: 继承MonoBehaviour的单例(也可以直接继承MonoBehaviour)
public partial class WebSocketClient : XObjBase
{
    private List<Button> _reqButtonList;
    private void AwakeRender()
    {
        _reqButtonList = new List<Button>();
    }

    private void EnqueueButton(Button button)
    {
        _reqButtonList.Add(button);
        button.transform.DOScaleX(0, 0.1f);
    }

    private void DequeueButtonAll()
    {
        try
        {
            foreach (var item in _reqButtonList)
            {
                item?.transform?.DOScaleX(1, 0.1f);
            }
        }
        catch (System.Exception e)
        {
            Debug.Log("Dequeue error:" + e.Message);
        }

        _reqButtonList.Clear();
    }
}
